<?php
  require_once('system/dbConn.php');
  require_once('system/myFunc.php');
  //连接数据库		
  connect();

  if(!empty($_FILES["xx_jiajulink"]["name"])){
  	$xx_jiajulink = uploadfile('xx_jiajulink','./uploads/',array('jpg','gif','png'));
  }
  else{
  	$xx_jiajulink='';
  }

  $data = array(
		'xx_name' => trim($_POST['xx_name']),  
		'xx_cid' => $_POST['xx_cid'],
		'xx_brand' => $_POST['xx_brand'],
		'xx_intro' => $_POST['xx_intro'],
		'xx_jiajulink'=>$xx_jiajulink
  	);
  

  //执行SQL语句
	$result = add('jiaju',$data);

  if(!$result){
  	echo "注册失败！<br/>";
  	echo "<a href='addjiaju.php'>返回</a>";	  
  }else{	  
 	echo "添加成功！";
	echo "或返回<a href='list.php'>家具列表</a>页面！";	  
  }    
  
?>